<?php

use app\models\Audio;
use app\models\Label;
use app\models\User;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\AudioLabel */
/* @var $form yii\widgets\ActiveForm */



$labels = Label::find()->all();
$users = User::findAll(['is_admin'=>1]);
$audios = Audio::find()->all();

?>

<div class="audio-label-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'audio_id')->dropDownList(ArrayHelper::map($audios, 'id', 'title')) ?>

    <?= $form->field($model, 'label_id')->dropDownList(ArrayHelper::map($labels, 'id', 'name')) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
